package com.leyou.trade.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.trade.entity.Order;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface OrderMapper extends BaseMapper<Order> {
    @Update("update tb_order set status = 5,close_time = #{closeTime,jdbcType=DATE} where status = 1 and create_time < #{createTime,jdbcType=DATE}")
    boolean updateByStatusAndTime(@Param("date") Date date, @Param("deadLine") Date deadLine);

    @Select("select * from tb_order where status = 1 and create_time < #{createTime,jdbcType=DATE}")
    List<Order> queryOrder(Date deadLine);
//    @Select("select * from tb_order where order_id = #{orderId}")
//    OrderDTO getOrderDTOById(@Param("orderId") Long orderId);
}
